<template>
  <!--门店详情-->
  <div>
    <p class="names">{{shop.shopName}}</p>
    <p class="imgid"><img :src="shop.shopImg | imgPathFilter" alt="" width="99%"></p>
    <div class="bgeee">
      <ul class="address">
        <li><img src="../../assets/clock.png" alt="" width="15"><span>{{shop.shopTime}}</span></li>
        <li><span><img src="../../assets/address.png" alt="" width="15"></span>
          <span>{{shop.shopAddress}}</span></li>
        <!--<li>
          <span><img src="../../assets/call.png" alt="" width="14">{{shop.shopPhone}}</span>
        </li>-->
      </ul>
      <ul class="note">
        <div v-html="shop.shopDesc"></div>
      </ul>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  import {getShopDetail} from '../../../test/unit/http'
  import {Toast} from 'we-vue'

  export default {
    name: 'shopdetail',
    props: {},
    data() {
      return {
        imgList: [],
        isVisible: false,
        shop: {},
      };
    },
    methods: {
      getShopDetailData(params) {
        getShopDetail(params).then(res => {
          console.log(res);
          if (res.code == 100) {
            this.shop = res.object;
            let shopImg = res.object.shopImg;
            if (!this.$myUtils.isNull(shopImg)) {
              this.imgList = shopImg.split(',');
            }
          } else {
            Toast.fail(res.info)
          }
        })
      }
    },
    created() {
      let shopId = this.$route.query.shopId;
      let params = {shopId: shopId};
      this.getShopDetailData(params);
    },
    components: {
    }
  }
</script>


<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .names {
    font-size: 18px;
    color: #111;
    font-weight: 700;
    padding: 10px;
    text-align: left;
  }

  .price {
    padding: 10px;
    text-align: left;

    li:first-child {
      font-size: 15px;
      color: #999;
    }

    li:last-child {
      font-size: 15px;
      color: #000;
      font-weight: 700;

      .xiaoliang {
        float: right;
        font-size: 12px;
        color: #999;
      }
    }
  }
  .imgid {
    position: relative;

    span {
      position: absolute;
      top: 20px;
      right: 28px;
      color: #7b4813;
      font-weight: 700;
    }
  }
  .bgeee {
    background-color: #eee;
    font-size: 12px;
    color: #666;
    text-align: left;
    padding-top: 10px;

    .address {
      background-color: #fff;
      padding: 10px;

      li {
        display: flex;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;

        img {
          margin-right: 5px;
        }

        span {
          line-height: 22px;
        }
      }

      li:nth-child(2) {
        display: flex;
        padding: 10px 0;
        height: auto;
        align-items: center;

        span:first-child {
          flex: 0 20px;

          img {
            vertical-align: top;
            padding-top: 5px;
          }
        }

        span:last-child {
          line-height: 22px;
        }
      }

      li:last-child {
        display: flex;
        border-bottom: none;

        span {
          flex: 1;
        }

        :first-child {
          color: #e96775;
        }
      }
    }

    .shebei {
      background-color: #fff;
      margin: 10px;
      border-radius: 4px;
      display: flex;
      padding: 20px 10px 10px;
      flex-wrap: wrap;

      li {
        width: 25%;
        text-align: center;
        font-size: 12px;
        color: #666;
        margin-bottom: 10px;

        p {
          height: 30px;
        }
      }
    }

    .note {
      background-color: #fff;
      padding: 10px 10px 85px;
      margin-bottom: 85px;

      li {
        font-size: 14px;
        color: #666;
        margin-bottom: 10px;

        p {
          font-size: 16px;
          color: #111;
          font-weight: 700;
        }
      }
    }

    .bottom {
      background-color: #eee;
      display: flex;
      padding: 10px;
      position: fixed;
      bottom: 0;
      width: 100%;

      li {
        flex: 1;

      }

      :first-child {
        font-size: 12px;
        color: #999;

        p {
          color: #fc8d4e;
          font-size: 18px;
        }
      }

      :nth-child(2) {
        button {
          background-image: linear-gradient(to left, #ff8551, #f9964e);
          color: #fff;
          height: 40px;
          line-height: 30px;
          border-radius: 5px;
          border: none;
          width: 120px;
        }
      }

      :last-child {
        button {
          background-image: linear-gradient(to left, #ff8551, #f9964e);
          color: #fff;
          height: 40px;
          margin-left: 5px;
          line-height: 30px;
          border-radius: 5px;
          border: none;
          width: 120px;
          margin-right: 20px;
        }
      }
    }
  }

  .bg {
    background-color: rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 50px;
  }

  .model .modelContent {
    background-color: #fff;
    border-radius: 8px;
    position: fixed;
    left: 50%;
    top: 50%;
    margin-left: -43%;
    margin-top: -111px;
    z-index: 2;
    padding: 40px 10px 20px;
    width: 80%;
    text-align: left;

    img {
      position: absolute;
      right: 10px;
      top: 10px
    }

    .btn {
      button {
        height: 42px;
        line-height: 42px;
        color: #fff;
        outline: none;
        border: none;
        width: calc(50% - 20px);
        border-radius: 8px;
        margin-top: 25px;
      }

      :last-child {
        background-color: #f9964e;

      }

      :first-child {
        background-color: #ccc;
        margin-right: 20px;

      }
    }

  }

  .model .buzu {
    text-align: center;

    .btn button {
      width: 100%;
    }
  }
</style>
